/* Geneone Emoticon Plugin */
var emoticonurl = geneurl + 'ui/emoticons/';

tinyMCE.addToLang('geneone_emoticons',{
	'title' : 'Emoticons',
desc : 'Emoticons'
});

var TinyMCE_GeneoneEmoticonsPlugin = {
	getInfo : function() {
		return {
			longname : "Emoticons",
			author : "Geneone",
			authorurl : "http://geneone.neondragon.net",
			infourl : "http://geneone.neondragon.net",
			version : "1.0"
		};
	},

	/**
	 * Returns the HTML contents of the emotions control.
	 */
	getControlHTML: function(cn) {
		switch (cn) {
			case "geneone_emoticons":
				return tinyMCE.getButtonHTML(cn, 'lang_geneone_emoticons_desc', ui['emoticons']+'icon.gif', 'mceGeneoneEmoticon');
		}
	
		return "";
	},

	/**
	 * Executes the mceEmotion command.
	 */
	execCommand : function(editor_id, element, command, user_interface, value) {
		// Handle commands
		switch (command) {
			case "mceGeneoneEmoticon":
				var template = new Array();

				template['file'] = '../../plugins/geneone_emoticons/emotions.htm'; // Relative to theme
				template['width'] = 230;
				template['height'] = 220;

				// Language specific width and height addons
				template['width'] += tinyMCE.getLang('lang_emotions_delta_width', 0);
				template['height'] += tinyMCE.getLang('lang_emotions_delta_height', 0);

				tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});

				return true;

				return true;
		}

		// Pass to next handler in chain
		return false;
	}
};

tinyMCE.addPlugin('geneone_emoticons', TinyMCE_GeneoneEmoticonsPlugin);
